package com.sakura.system.entity.gld;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.Entity;

import javax.persistence.*;
import java.util.Date;

@Data
//@Entity
@Table(name = "user")
public class User {

//    @JsonSerialize(using = ToStringSerializer.class)//解决8位long精度丢失问题
    @Id
    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
//    @TableId(type = IdType.ID_WORKER)
    private String id;
    @Alias("用户名")
    @Column(name="username")
    private String username;
    @Alias("密码")
    @Column(name = "password")
    private String password;
    @Alias("年龄")
    @Column(name = "age")
    private Integer age;
    @Alias("性别")
    @Column(name = "sex")
    private String sex;
    @Alias("电话")
    @Column(name = "phone")
    private String phone;
    @Column(name = "role_id")
    private String roleId;
    @Column(name = "pic")
    private String pic;
    @Column(name = "isdel")
    private Boolean isdel;
    @Column(name = "createtime")
    private Date createtime;
    @Column(name = "updatetime")
    private  Date updatetime;
    @Column(name = "deletetime")
    private  Date deletetime;

    @Transient  // 告诉其,token不是数据库
    private String token;


//    public User1(long id, String username, String password, String sex, Integer age, String phone) {
//        this.id = id;
//        this.username = username;
//        this.password = password;
//        this.sex = sex;
//        this.age = age;
//        this.phone = phone;
//    }
}
